Skip to content

feat: marking public APIs with annotations#3428

Closed
csviri wants to merge 8 commits into
operator-framework:nextfrom
csviri:public-api-annotation
Closed

feat: marking public APIs with annotations#3428
csviri wants to merge 8 commits into
operator-framework:nextfrom
csviri:public-api-annotation

Conversation

@csviri

@csviri csviri commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

csviri and others added 7 commits June 17, 2026 14:26
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
…3263)

Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
…does not have to be Kubernetes resources (operator-framework#3377)

Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
…y deadline (operator-framework#3380)

Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 18, 2026
@csviri csviri linked an issue Jun 18, 2026 that may be closed by this pull request
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>

@xstefank xstefank left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed on the meeting, I don't think introducing this kind of new API that we would need to continuously maitain would add much better approach of what is public and what is not. We should have a clearly defined rules, but users will not check this and we would need to remember to take care of keeping all annotations in check.

@csviri

csviri commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator Author

As we discussed on the meeting, I don't think introducing this kind of new API that we would need to continuously maitain would add much better approach of what is public and what is not. We should have a clearly defined rules, but users will not check this and we would need to remember to take care of keeping all annotations in check.

I'm also not fully convinced TBH either, will come back to this a bit later. Also we can discuss more in community calls.

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 30, 2026
@openshift-ci

openshift-ci Bot commented Jun 30, 2026

Copy link
Copy Markdown

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@csviri

csviri commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

@SamBarker @robobario @afalhambra-hivemq @gyfora @jiangzho @dongjoon-hyun

If you could give us feedback on this topic would be really helpful (see also related/linked issue), pls let us know if you see value in this (or not :) ).

thank you!!

@dongjoon-hyun dongjoon-hyun left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pinging me, @csviri . The idea looks reasonable. Just two questions.

  1. Are you going to mark every class and API into those three categories?
  2. What happens for the existing downstream users who use some APIs which becomes Internal or Experimental or unmarked by this PR?

@csviri

csviri commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

Thank you for pinging me, @csviri . The idea looks reasonable. Just two questions.

thank you for reply!!

  1. Are you going to mark every class and API into those three categories?

For practical reasons I originally planned just to make public API classes with @Public annotation; all other classes would be considered internal. But if a method what we for some reason we are not able to make non public, we will mark @Internal. But it is up to discussion, if that would bring more clarity, we marks all classes with one of those categories.

  1. What happens for the existing downstream users who use some APIs which becomes Internal or Experimental or unmarked by this PR?

The @Experimental we already use, those members are subject of possible API change, there are not new changes regarding that.

If we marks an API @Public we would just guarantee that those won't change in a non backwards compatible way, so basically will change only in a major release. But this is purely serves as documentation, nothing will be enforced. For internal classes/methods we will not have that guarantee.

However, note that even this is sometimes hard to follow, and there might be no way around to change it in some exceptional cases. Considering for example change like we did between 4.2 -> 4.3, with condition API:
https://javaoperatorsdk.io/docs/migration/v4-3-migration/#condition-api-change

Where there was had good to have Conditions work on top of Dependent resources, not just secondary resource.
Shall we do it only in a major release in this case? According to semver yes. But we decided - since the conversion path is trivial - to not do that. So maybe in future, we might use more extensively @Experimental on new features, so we allow such changes. It is again up to discussion.

But, since we might do such minor changes anyways, it might be reasonable to define @Public in a way that those are classes users should use directly (not the others), and we follow semver as best effort (se exceptionally actually we might break semver).

So those are the dilemmas I see with this.

@csviri csviri deleted the branch operator-framework:next July 2, 2026 12:55
@csviri csviri closed this Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Marking public APIs with @Public annotation

4 participants